package com.saas.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.env.Environment;

import javax.annotation.Resource;

/**
 * @Author: lzqing
 * @Description: RSA生成公钥私钥管理类
 * @Date: Created in 2021/6/6
 */
public class RSACheckBean implements BeanPostProcessor {

    @Resource
    private Environment environment;

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        String property = environment.getProperty("aaa.bbb");
        System.out.println("test3" + property);
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }
}
